home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10352 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: solon.com!not-for-mail
  2. From: fred@genesis.demon.co.uk (Lawrence Kirby)
  3. Newsgroups: comp.lang.c,comp.lang.c.moderated,comp.sys.hp.apps,comp.sys.hp.hpux
  4. Subject: C coding problem
  5. Date: 16 Mar 1996 21:55:45 -0600
  6. Organization: none
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4ig2g1$gcr@solutions.solon.com>
  10. References: <4ianbf$h86@solutions.solon.com> <4iem7b$9u6@solutions.solon.com>
  11. Reply-To: fred@genesis.demon.co.uk
  12. NNTP-Posting-Host: solutions.solon.com
  13. X-Mailer: Demon Internet Simple News v1.27
  14.  
  15. In article <4iem7b$9u6@solutions.solon.com>
  16.            soosterh@uoguelph.ca "Samuel Oosterhuis" writes:
  17.  
  18.  >         /* loop once for each parameter */
  19.  >         while( --argc > 0 ){
  20.  >                 /* check if the parameter starts with '-' */
  21.  >                 if((*++argv)[0] == '-' )
  22.  >                         option_val = read_options;
  23.  >                 /* rest of the loop stuff */
  24.  >         }
  25.  > 
  26.  
  27. ...
  28.  
  29.  > [Note that the example contains an error, which is that it increments
  30.  >  argv[n]. -mod]
  31.  
  32. I see this incrementing argv but not argv[n].
  33.  
  34. [I am blessed with the clarity of a politician.  The example on page 117
  35.  of K&R increments an argv[n]. -mod]
  36. -- 
  37. -----------------------------------------
  38. Lawrence Kirby | fred@genesis.demon.co.uk
  39. Wilts, England | 70734.126@compuserve.com
  40. -----------------------------------------
  41.